package spring.service.impl;

import spring.service.MyService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author tuyou_cd
 * @Date 2020/6/19 15:31
 */
@Profile("server")
@Component
public class MyServiceImpl implements MyService {

    private int count = 0;

    @Override
    public int add(int a, int b) {
        System.out.println(++count + "次调用");
        return a + b;
    }

    @Override
    public int sub(int a, int b) {
        System.out.println(++count + "次调用");
        return  a - b;
    }
}
